/**
 * 
 */
package com.ctn.bootstarp.tags.ui;

import java.io.IOException;

import javax.servlet.jsp.JspException;

import tldgen.Tag;
import tldgen.TagAttribute;

import com.ctn.bootstarp.tags.AppTag;
import com.ctn.bootstarp.tags.util.TagUtil;

/**
 * @author weiqi
 * @date 2013年8月6日
 */
@Tag
public class TableColumnTag extends AppTag {

	private static final long serialVersionUID = -7476244717503608427L;
	
	private String name;

	@TagAttribute(required=true,description="column name")
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public void doInitBody() throws JspException {
		if(null==this.getParent() || !(this.getParent() instanceof TableTag)){
			try {
				this.getBodyContent().write(TagUtil.printError("!TableColumnTag必须放在TableTag里面"));
			} catch (IOException e) {
				e.printStackTrace();
			}
		}else{
			TableTag table = (TableTag) this.getParent();
		}
		super.doInitBody();
	}
	
	@Override
	public void release() {
		this.name = null;
		super.release();
	}
	
}
